package edu.sctu.wulixia.month6.day20150614;

import sun.font.FileFontStrike;

import java.io.File;
import java.io.IOException;

/**
 * Created by user05 on 2015/6/14.
 */
public class AddFile {
    //添加一个文件夹
    public void isAddFile(){
        File file = new File("D://wulixia//");

        if(!file.exists()){
            file.mkdir();
            System.out.println(file.getName()+"文件夹创建成功！");
        }
    }

    //在文件夹中添加文件
    public void isAddDoument(){
        File file1 = new File("D://wulixia//wangliu.txt");

        try {
            file1.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println(file1.getName());
        System.out.println(file1.getAbsolutePath());

    }
}
